<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr">
<c:set var="currentMenu" value="${empty boardType ? board.boardType : boardType }" />
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="author" content="" />
<title>JK Holdings</title>
<script src="/js/jquery-1.6.4.js"></script>
<script type="text/javascript">
$(document).ready(function() {
	
	$('#saveButton').click(function(){
		$('#boardForm').submit();
	});
	
	$('#listButton').click(function(){
		location.href = "/products.do";
	});

});
</script>
<link rel="stylesheet" type="text/css" href="/css/style.css" media="screen" />
</head>

<body id="top">
	<!-- 공통 헤더 시작 -->
	<%@ include file="/WEB-INF/head.jsp"%>
	<!-- 공통 헤더 끝 -->

	<!-- 메인 네비게이션 시작  -->
	<%@ include file="/WEB-INF/navigation.jsp"%>
	<!-- 메인 네비게이션 끝  -->

	<div id="content-wrapper">
		<div class="center-wrapper">

			<div class="content" id="content-two-columns">

				<div id="main-wrapper">
					<div id="main">
						<form id="boardForm" method="post" action="/products/form/update.do" enctype="multipart/form-data">
							<div class="post">
								<div class="post-title">
									<h1>
										상품 수정
									</h1>
								</div>
								<div class="post-body">
									<table class="data-table">
										<tr>
											<th>제목</th>
											<td colspan="3"><input type="text" name="productName" id="title" value="${product.productName}"/></td>
										</tr>
										<tr>
											<th>모델명</th>
											<td><input type="text" name="productModelName" id="modelName" value="${product.productModelName}" /></td>
											<th>제조일시</th>
											<td><input type="text" name="productRegistrationDay" id="produceDate" value="${product.productRegistrationDay}"  /></td>
										</tr>
										<tr>
											<th>사이즈</th>
											<td><input type="text" name="productSize" id="productSize" value="${product.productSize}"/></td>
											<th>용도</th>
											<td><input type="text" name="productPurposes" id="productPurposes" value="${product.productPurposes}" /></td>
										</tr>
										<tr>
											<th>카테고리</th>
											<td colspan="3">
												<select name="productCategoryId" id="productCategoryId">
													<c:forEach var="categorySelectBox" items="${categorySelectBoxList}">
														<option value="${categorySelectBox.categoryId}" <c:if test="${categorySelectBox.categoryId == product.productCategoryId}">selected="selected"</c:if> >${categorySelectBox.categoryFullName}</option>
													</c:forEach>
												</select>
											</td>
										</tr>
										<tr>
											<th>대표이미지</th>
											<td colspan="3"><input type="file" name="productThumbnail" value="${product.productThumbnailName}"/></td>
										</tr>
										<tr>
											<th>설명이미지</th>
											<td colspan="3"><input type="file" name="productImage" value="${product.productImageName}"/></td>
										</tr>
									</table>
									<input type="hidden" name="productDesc" 		id="productDesc" 		value="${product.productDesc}" />
									<input type="hidden" name="productPurposes" 	id="productPurposes" 	value="${product.productPurposes}" />
									<input type="hidden" name="productSize" 		id="productSize" 		value="${product.productSize}" />
									<input type="hidden" name="productId" 			id="productId" 			value="${product.productId}" />
									
								</div>
							</div>
						</form>
						<button id="saveButton" type="button" class="save" title="저장">
							<span>수정</span>
						</button>
						<button id="listButton" type="button" class="list" title="목록">
							<span>목록</span>
						</button>
					</div>
				</div>

				<div id="sidebar-wrapper">
					<div id="sidebar">

						<!-- 카테고리 box 시작 -->
						<%@ include file="/WEB-INF/category.jsp"%>
						<!-- 카테고리 box 끝 -->

						<div class="box nobborder">

							<div class="box-title">About</div>

							<div class="box-content">
								<p>뭔가 About 설명이 들어가야할 영역</p>
							</div>

						</div>

					</div>
				</div>

				<div class="clearer">&nbsp;</div>

			</div>

		</div>
	</div>

	<!-- bottom 시작 -->
	<%@ include file="/WEB-INF/bottom.jsp"%>
	<!-- bottom 끝 -->

</body>
</html>